Skip to content

[registrar] Import the framework for NSObject types used in method signatures. - #26418

Merged
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/fw-method-sigs
Aug 6, 2026
Merged

rolfbjarne merged 1 commit into
mainfrom
dev/rolf/fw-method-sigs

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

The static registrar could emit method signatures referencing an Objective-C
type whose framework header wasn't imported in the generated code, which made
the generated code fail to compile:

registrar.h:266:27: error: expected a type
  266 |         -(void) registerWebView:(WKWebView *)p0;
      |                                  ^

This happened for a wrapper type from a binding project (Google.MobileAds'
GADMobileAds) with a method taking a WebKit.WKWebView parameter, where nothing
else in the app pulled in the WebKit framework: 'CheckNamespace' is only called
for the types the registrar iterates over, not for the types showing up in the
generated method signatures.

Fix this by calling 'CheckNamespace' in 'ToObjCParameterType' for platform
NSObject types, so that the corresponding '#import <Framework/Framework.h>' is
always emitted.

Copilot-Session: ddb2f938-9d62-4ccf-8ce8-70056d74178b

…gnatures.

The static registrar could emit method signatures referencing an Objective-C
type whose framework header wasn't imported in the generated code, which made
the generated code fail to compile:

    registrar.h:266:27: error: expected a type
      266 |         -(void) registerWebView:(WKWebView *)p0;
          |                                  ^

This happened for a wrapper type from a binding project (Google.MobileAds'
GADMobileAds) with a method taking a WebKit.WKWebView parameter, where nothing
else in the app pulled in the WebKit framework: 'CheckNamespace' is only called
for the types the registrar iterates over, not for the types showing up in the
generated method signatures.

Fix this by calling 'CheckNamespace' in 'ToObjCParameterType' for platform
NSObject types, so that the corresponding '#import <Framework/Framework.h>' is
always emitted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ddb2f938-9d62-4ccf-8ce8-70056d74178b
Copilot AI review requested due to automatic review settings August 6, 2026 17:29
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner August 6, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 8c12572c897e1c6e25cb94f8e93fbed1c6fd074c [PR build]

@rolfbjarne
rolfbjarne enabled auto-merge (squash) August 6, 2026 18:22
@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Aug 6, 2026
@rolfbjarne
rolfbjarne requested a review from Copilot August 6, 2026 18:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #8c12572] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 205 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 8c12572c897e1c6e25cb94f8e93fbed1c6fd074c [PR build]

@rolfbjarne
rolfbjarne merged commit ed5bb66 into main Aug 6, 2026
52 of 57 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/fw-method-sigs branch August 6, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants